Skip to content

Rename builder parameter to onSuccess in RequestCubitBuilder (#49)#50

Merged
piotruela merged 3 commits into
leancodepl:mainfrom
SKnoedler:feature/rename-builder-to-onSuccess
Jul 7, 2025
Merged

Rename builder parameter to onSuccess in RequestCubitBuilder (#49)#50
piotruela merged 3 commits into
leancodepl:mainfrom
SKnoedler:feature/rename-builder-to-onSuccess

Conversation

@SKnoedler

Copy link
Copy Markdown
Contributor

🔧 Fixes #49

This PR implements the proposal to rename the builder parameter to onSuccess in RequestCubitBuilder to improve API consistency and clarity.


✅ Changes Made

  • Renamed builder parameter to onSuccess in RequestCubitBuilder
  • Updated all example code and tests to use the new parameter name
  • Updated README documentation
  • Updated changelogs with breaking change notice

⚠️ Breaking Change

This is a breaking change that requires users to update their code from:

RequestCubitBuilder<MyState>(
  builder: (context, state) => MyWidget(),
);

To:

RequestCubitBuilder<MyState>(
  onSuccess: (context, state) => MyWidget(),
);

The new parameter name onSuccess better aligns with the existing naming convention (onInitial, onLoading, onError) and makes the API more intuitive and consistent.

SKnoedler added 3 commits July 5, 2025 11:15
- Rename the 'builder' parameter to 'onSuccess' in RequestCubitBuilder class
- Update constructor comment to reflect the change
- Update field declaration comment
- Update all usages in build method (RequestSuccessState and RequestRefreshState)
- Update all example code to use the new parameter name
- Update all test files to use the new parameter name
- Update README documentation to reflect the change

This change makes the parameter name more descriptive and aligns with the naming convention of other state handlers (onInitial, onLoading, onError).

Resolves: leancodepl#49
- Bump leancode_cubit_utils version from 0.3.2 to 0.4.0
- Bump leancode_cubit_utils_cqrs version from 0.3.1 to 0.4.0
- Update leancode_cubit_utils_cqrs dependency to ^0.4.0
- Add changelog entries documenting the breaking change

This follows semantic versioning best practices where breaking changes
in pre-1.0 software bump the minor version (0.x.y -> 0.x+1.0).
@piotruela piotruela merged commit 507fced into leancodepl:main Jul 7, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Rename builder parameter to onSuccess in RequestCubitBuilder

3 participants